home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Atari Compendium
/
The Atari Compendium (Toad Computers) (1994).iso
/
files
/
prgtools
/
langs
/
isetl.arc
/
bignum.t
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
Text File
|
1987-08-20
|
321 b
|
13 lines
f := func(a,b); if b>0 then return a mod b; end; end;
g := func(a,b); if b>0 then return a - a div b * b - a mod b; end;end;
for x,y in [5,9990,12000,123456789] do
[a,b] := [x,y];
print [a mod b >= 0, -a mod b >= 0,
g(a,b)=0, g(-a,b)=0, a div -b = -(a div b),
[a,b], a div b, a mod b];
end;